#
#   Messages.py
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; version 2 of the License.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   Copyright
#   Author: Nicholas F. Hoover
#   Contributors: Salvatore S. Gionfriddo
#   Created: 2007.07.01
#   Last Modified: 2007.07.08
#

import hud

def printLoading(screen):
    loadingString = "Loading..."
    loadingLabel = hud.label(screen,(20,575), loadingString)
    loadingLabel.setSize(25)
    loadingLabel.draw()

def printDoneLoading(screen):
    loadingString = "Loading... DONE"
    loadingLabel = hud.label(screen,(20,575), loadingString)
    loadingLabel.setSize(25)
    loadingLabel.draw()
    pressEnterString = "Press Enter"
    pressEnterLabel = hud.label(screen,(700,575), pressEnterString)
    pressEnterLabel.setSize(25)
    pressEnterLabel.draw()
    
def printInstructions(screen):
    strings = ("Instructions:",
               "Use arrow keys to move. Additional instructions will follow each level.",
               "General control:",
               "     P: pause",
               "     F: toggle FPS display",
               "     M: toggle music",
               "     Enter: continue from instructions, un-pause",
               "     Escape: to Quit.",
               "Press Enter to Play Now. Good Luck!")
    
    yPosition = 50
    for string in strings:
        instructionLabel = hud.label(screen,(100,yPosition), string)
        instructionLabel.setBackColor((200,200,200))
        instructionLabel.draw()
        yPosition += 14

def printPaused(screen):
    pausedString = "Game Paused. Press Enter to continue or Escape to quit."
    pausedLabel = hud.label(screen,(200,100), pausedString)
    pausedLabel.setBackColor((200,200,200))
    pausedLabel.draw()


def printGameOver(screen):
    youDiedString = "You died. :-("
    tryAgainString = "Press Enter to try again or Escape to quit."
    youDiedLabel = hud.label(screen,(100,200), youDiedString)
    youDiedLabel.setBackColor((200,200,200))
    youDiedLabel.draw()
    tryAgainLabel = hud.label(screen,(100,214), tryAgainString)
    tryAgainLabel.setBackColor((200,200,200))
    tryAgainLabel.draw()

def printScores(screen, score, highScore):
    scoreLabel = hud.label(screen,(100,250), 'Score: ' + str(score))
    scoreLabel.setBackColor((200,200,200))
    scoreLabel.draw()

    highScoreLabel = hud.label(screen,(100,300), 'High Score: ' + str(highScore))
    highScoreLabel.setBackColor((200,200,200))
    highScoreLabel.draw()
    
def printLevel(screen, level, level_desc):
    levelLabel = hud.label(screen,(100,200), 'Level: ' + str(level))
    levelLabel.setBackColor((200,200,200))
    levelLabel.draw()


    yPosition = 225
    for string in level_desc:
        if string != "":
            descLabel = hud.label(screen,(100,yPosition), string)
            descLabel.setBackColor((200,200,200))
            descLabel.draw()
        yPosition += 14
